﻿<%@ Page Language="C#" MasterPageFile="~/admin/admin_page.master"  AutoEventWireup="true" CodeBehind="product_integratepurchas_edit.aspx.cs" Inherits="YXShop.Web.admin.product.product_integratepurchas_edit" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link rel="stylesheet" href="../style/validator.css" type="text/css" />
    <script type="text/javascript" src="../../scripts/validate.js"></script>
    <script type="text/javascript" src="../../scripts/calendar.js"></script>
    <script src="../../scripts/prototype.js" type="text/javascript"></script>
    <script src="../scripts/public.js" type="text/javascript"></script>
    <script type="text/javascript" language="javascript">
    var num=0;
    function add1()
    {
        var i=document.getElementById("Conut").value;
        document.getElementById("Conut").value=eval(i)+1;
        window.document.getElementById("a").innerHTML=window.document.getElementById("a").innerHTML + "<br/>数量:<input type='text' id='up"+num+"' name='txtwsl'  style='width:135px' > 价格:<input id='up1"+num+"' name='txtwjg' type='text' style='width:135px '/><a href='#' onClick='javascript:del("+num+");'>删除</a>";  
        num=num+1;
    }
    function del(n)
    {
        num=num-1;
        var i=document.getElementById("Conut").value;
        document.getElementById("Conut").value=eval(i)-1;
        var str=window.document.getElementById("a").innerHTML;
        var regEx=new RegExp("<BR>数量:<[^<>]*(up"+n+"){1}[^<>]*> 价格:<[^<>]*(up1"+n+"){1}[^<>]*><[^<>]*>[^<>]*</A>");
        str=str.replace(regEx,"");
        window.document.getElementById("a").innerHTML=str;
    }
    function StrAdd1()
    {
        var i= "<%=strid%>";
        var m= "<%=strmm%>";
        var q="<%=strqq%>" 
        var b = m.split(',');
        var s = q.split(',');
        var str = "";
        for (k = 1; k < i; k++)
        {
            document.getElementById("Conut").value=k+1;
            str = window.document.getElementById("a").innerHTML + "<br>数量:<input type='text' id='up"+k+"' name='txtwsl'  style='width:135px'  value='" +b[k]+"'>价格:<input id='up1"+k+"' name='txtwjg' type='text' style='width:135px ' value='" +s[k]+"'/><a href='#' onClick='javascript:del("+k+");'>删除</a>";  
            document.getElementById("a").innerHTML = str
        }
        num=num+1;
    }

    function add2()
    {
        for(j =0; j<num;j++)
        {
            var t =  document.getElementById("up"+j).value;
            var oo = document.getElementById("up1"+j).value;
            var tt =  document.getElementById("up"+j);
            vTel5=tt.value;
            if(vTel5.search(/^[0-9]*[1-9][0-9]*$/))
            {
                document.getElementById("CouPriceSpan").innerHTML="<span style='color:red'> * 数量输入整数类型且不能为空</span>"
                tt.focus();
                tt.select();
                return false;
            }
            else
            {
                document.getElementById("CouPriceSpan").innerHTML=""
            }

            if(isNaN(oo)||isNaN(t))
            {
                document.getElementById("CouPriceSpan").innerHTML="<span style='color:red'>  * 价格输入数值类型且不能为空</span>"
                return  false;
            }
            else
            {
                document.getElementById("CouPriceSpan").innerHTML=""
            }
        }
        return true;
    }

</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="pagetitle" runat="server">团购商品
    <asp:Button ID="button1" runat="server" CssClass="inputbutton" onclick="LinkButton1_Click" Text="保  存" onMouseOver="javascript:document.getElementById(this.id).className='inputbutton_a'" onMouseOut="javascript:document.getElementById(this.id).className='inputbutton'"/>
    <asp:HyperLink ID="HyperLink1" runat="server"  CssClass="inputbutton" NavigateUrl="product_integratepurchas_list.aspx" Width="65px" Height="24px" onMouseOver="javascript:document.getElementById(this.id).className='inputbutton_a'" onMouseOut="javascript:document.getElementById(this.id).className='inputbutton'">返回列表</asp:HyperLink>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="pageinfo" runat="server">添加或编辑团购信息&nbsp; 
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="workspace" runat="server">
    <asp:Panel ID="pnlMsg" runat="server" Visible="false" CssClass="pnlReturnMessageErr">
        <asp:Literal ID="ltlMsg" runat="server"></asp:Literal>
    </asp:Panel>
     <table  class="form_table_input" border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
            <td class="form_table_input_info">
                团购商品：
            </td>
            <td>
                <asp:TextBox ID="txtProductName" runat="server"></asp:TextBox>
                <asp:HiddenField runat="server" ID="hfid" />
            </td>
            <td>
                <asp:Panel ID="txtProductNameTip" runat="server"></asp:Panel>
            </td>
        </tr>
        <tr>
            <td class="form_table_input_info">
                活动开始时间：
            </td>
            <td>
                <asp:TextBox ID="txtStartTime" CssClass="date_input" runat="server"></asp:TextBox>
            </td>
           <td>
                <asp:Panel ID="txtStartTimeTip" runat="server"></asp:Panel>
            </td>
        </tr>
        <tr>
            <td class="form_table_input_info">
                活动结束时间：
            </td>
            <td>
                <asp:TextBox ID="txtEndTime" CssClass="date_input" runat="server"></asp:TextBox>
            </td>
           <td>
                <asp:Panel ID="txtEndTimeTip" runat="server"></asp:Panel>
            </td>
        </tr>
        <tr>
            <td class="form_table_input_info">
                保证金：
            </td>
            <td>
                <asp:TextBox ID="txtDeposit" runat="server" Width="169px" MaxLength="8" ></asp:TextBox>
            </td>
            <td>
                <asp:Panel ID="txtDepositTip" runat="server"></asp:Panel>
            </td>
        </tr>
        <tr>
            <td class="form_table_input_info">
                限购数量：
            </td>
            <td>
                <asp:TextBox ID="txtCount" runat="server" Width="168px" MaxLength="10"></asp:TextBox>
            </td>
            <td>
                <asp:Panel ID="txtCountTip" runat="server"></asp:Panel>
            </td>
        </tr>
        <tr>
            <td class="form_table_input_info">
                赠送积分：
            </td>
            <td>
                <asp:TextBox ID="txtDonateIntegral" runat="server" Width="168px" MaxLength="10"></asp:TextBox>
            </td>
            
        </tr>
        <tr>
            <td class="form_table_input_info">
                价格阶梯：
            </td>
            <td colspan="2">
                            <div id="a">
                数量:<asp:TextBox ID="txtsl" runat="server" Width="135px"></asp:TextBox>
                价格:<asp:TextBox ID="txtjg" runat="server" Width="135px"></asp:TextBox>(数量与享受价)<a href="javascript:add1()">添加</a>
                                <asp:Label ID="Label1" runat="server" ForeColor="Red"></asp:Label><span id="CouPriceSpan" style="color:Red"></span>
</div>
               <input id="txtp" name="Conut" type="text" value="1" style="display: none;" />
            </td>
           
        </tr>
        <tr>
            <td class="form_table_input_info">
                活动描述：
            </td>
            <td>
                <asp:TextBox ID="txtDescription" runat="server" TextMode="MultiLine" MaxLength="1000" Height="100px" Width="268px"></asp:TextBox>
            </td>
            <td>
                <div class="msgNormal">适动描述不能超过1000个字符.</div>
            </td>
        </tr>
        </table>
</asp:Content>
<asp:Content ContentPlaceHolderID="pagebottom" runat="server" ID="ContentBottom">
    <asp:Button ID="button2" runat="server" CssClass="inputbutton" onclick="LinkButton1_Click" Text="保  存" onMouseOver="javascript:document.getElementById(this.id).className='inputbutton_a'" onMouseOut="javascript:document.getElementById(this.id).className='inputbutton'"/>
    <asp:HyperLink ID="HyperLink2" runat="server"  CssClass="inputbutton" NavigateUrl="product_integratepurchas_list.aspx" Width="65px" Height="24px" onMouseOver="javascript:document.getElementById(this.id).className='inputbutton_a'" onMouseOut="javascript:document.getElementById(this.id).className='inputbutton'">返回列表</asp:HyperLink>
</asp:Content>
